package com.currency.mall.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.currency.mall.R;
import com.currency.mall.entity.SharesRoyalty;
import com.currency.mall.entity.WalletBean;

import java.util.List;

/**
 * Created by Administrator on 2018/12/5.
 */

public class GoldRateAdapter extends BaseQuickAdapter<SharesRoyalty, BaseViewHolder> {

    public GoldRateAdapter(@Nullable List<SharesRoyalty> data, Context context) {
        super(R.layout.item_gold_rate, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SharesRoyalty sharesRoyalty) {
        TextView tvCycle = helper.getView(R.id.tv_cycle);
        if("DAY".equals(sharesRoyalty.getType())){
            tvCycle.setText("权利金率 "+" ("+sharesRoyalty.getVal()+"天 )"+":");
        }else  if("WEEK".equals(sharesRoyalty.getType())){
            tvCycle.setText("权利金率 "+" ("+sharesRoyalty.getVal()+"周 )"+":");
        }else  if("MONTH".equals(sharesRoyalty.getType())){
            tvCycle.setText("权利金率 "+" ("+sharesRoyalty.getVal()+"月 )"+":");
        }
        helper.setText(R.id.tv_rold_rate,sharesRoyalty.getRate()+"%");

    }

}
